package com.emptyMe.org.controller;

import com.emptyMe.basic.utils.AjaxResult;
import com.emptyMe.org.domain.Department;
import com.emptyMe.org.domain.Employee;
import com.emptyMe.org.service.IEmployeeService;
import com.emptyMe.org.service.imp.EmployeeServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/employee")
@Api(tags = "员工接口", description = "员工接口详细api描述")
public class EmployeeController {
    @Autowired
    private IEmployeeService service;
//    EmployeeServiceImpl service;

    /**
     * 查询所有的Employee
     *
     * @param :
     * @return RequestBody : 表示获取请求提的json数据
     */
    /**/
    @GetMapping
    @ApiOperation(value = "获取所有员工")
    public AjaxResult getAll() {
        List<Employee> employees = service.loadAll();
        return AjaxResult.me(employees);
    }

//    @GetMapping("{/id}")
//    @ApiOperation(value = "获取所有员工")
//    public AjaxResult getAll(@PathVariable Long id) {
//        List<Employee> employees = service.loadAll();
//        return AjaxResult.me(employees);
//    }
}
